So i alocated some mem in growable heap and now i want it to be non growable
Posted on 2003-08-28 08:42:53 by AceEmbler
I don't think theres any simple way. You could create a new nongrowable heap and move everything from the growable heap into it.

Why would you want to do this?
Posted on 2003-08-28 12:09:09 by Eóin

Why would you want to do this?

It's becouse sometimes i dont want to write into mem any more by "mistake" .
Posted on 2003-08-29 10:25:23 by AceEmbler
Do you mean you don't want to go outside of array bounds, Like accessing element 101 of an array that only holds 100.

Growable and non-growable heaps won't help you here. Nongrowable heaps only stop you allocating extra memory once you've hit the max set for it. In both types you shouldn't be able to go outside of array bounds. The only exception would be possible padding for example, and this could have unpredicitable effects.
Posted on 2003-08-29 12:07:07 by Eóin
I'm using one macro to make growable heap but i dont know how big this thing will be, but after i create it i want to stop it to grow to avoid writing something there becouse i want to acces violation message when i will try to write something further.

sorry for this confusing message.:grin:
Posted on 2003-08-29 13:50:08 by AceEmbler
A heap is just something you allocate memory from. You will always get an access violation trying to write you memory you haven't allocated.

Growable or nongrowable affects how much memory you can allocate. Allocated memory affects access violations.

Besides you can't gaurantee an access violation will always occur.
Posted on 2003-08-29 17:44:14 by Eóin