mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-06-19 17:29:36 +00:00
Support allocations up to 32767 bytes in the pool-based allocator.
The previous limit was 4096 bytes, and trying to allocate more could lead to memory corruption. Raising the limit allows for longer string literals created via concatenation.
This commit is contained in:
parent
a888206111
commit
ba944e5675
14
MM.pas
14
MM.pas
|
@ -168,8 +168,11 @@ var
|
||||||
|
|
||||||
begin {GMalloc}
|
begin {GMalloc}
|
||||||
if bytes > globalSize then begin {allocate a new pool, if needed}
|
if bytes > globalSize then begin {allocate a new pool, if needed}
|
||||||
globalSize := poolSize;
|
if bytes > poolSize then
|
||||||
myhandle := NewHandle(poolSize, globalID, $C010, nil);
|
globalSize := bytes
|
||||||
|
else
|
||||||
|
globalSize := poolSize;
|
||||||
|
myhandle := NewHandle(globalSize, globalID, $C010, nil);
|
||||||
if ToolError <> 0 then TermError(5);
|
if ToolError <> 0 then TermError(5);
|
||||||
globalPtr := myhandle^;
|
globalPtr := myhandle^;
|
||||||
end; {if}
|
end; {if}
|
||||||
|
@ -209,8 +212,11 @@ var
|
||||||
|
|
||||||
begin {LMalloc}
|
begin {LMalloc}
|
||||||
if bytes > localSize then begin {allocate a new pool, if needed}
|
if bytes > localSize then begin {allocate a new pool, if needed}
|
||||||
localSize := poolSize;
|
if bytes > poolSize then
|
||||||
myhandle := NewHandle(poolSize, localID, $C010, nil);
|
localSize := bytes
|
||||||
|
else
|
||||||
|
localSize := poolSize;
|
||||||
|
myhandle := NewHandle(localSize, localID, $C010, nil);
|
||||||
if ToolError <> 0 then TermError(5);
|
if ToolError <> 0 then TermError(5);
|
||||||
localPtr := myhandle^;
|
localPtr := myhandle^;
|
||||||
end; {if}
|
end; {if}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user