www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - custom struct allocator not called

reply Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

# struct MyStruct{
#        new(size_t size){
#                return malloc(size);
#        }
# }

Added to DStress as
http://dstress.kuehne.cn/run/new_12.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFCTnDY3w+/yD4P9tIRAkIHAJ9UV775ux4Qj7D8nEx8VYSDVE9lQwCfS8YV
UXijlL96Gg7eDX06pLBLu+o=
=22Lx
-----END PGP SIGNATURE-----
Apr 02 2005
parent reply "Regan Heath" <regan netwin.co.nz> writes:
On Sat, 2 Apr 2005 12:15:52 +0200, Thomas Kuehne  
<thomas-dloop kuehne.thisisspam.cn> wrote:
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1

 # struct MyStruct{
 #        new(size_t size){
 #                return malloc(size);
 #        }
 # }

 Added to DStress as
 http://dstress.kuehne.cn/run/new_12.d

My impression of: http://www.digitalmars.com/d/memory.html#newdelete is that these are only possible for classes? Regan
Apr 02 2005
parent reply Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Regan Heath schrieb am Sat, 02 Apr 2005 22:33:19 +1200:
 On Sat, 2 Apr 2005 12:15:52 +0200, Thomas Kuehne  
<thomas-dloop kuehne.thisisspam.cn> wrote:
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1

 # struct MyStruct{
 #        new(size_t size){
 #                return malloc(size);
 #        }
 # }

 Added to DStress as
 http://dstress.kuehne.cn/run/new_12.d

My impression of: http://www.digitalmars.com/d/memory.html#newdelete is that these are only possible for classes?

New in dmd-0.119: # Changed documentation on struct/union grammar to allow invariants, # unit tests, and allocator/deallocators. See also StructBodyDeclaration at http://www.digitalmars.com/d/struct.html Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCTn0k3w+/yD4P9tIRAnAXAJ9rW/tDWpkR1fCsUJI5bDgf0xlAvACgoDS9 hj/dyvh8A2/7eDkODZpaKAI= =/L+3 -----END PGP SIGNATURE-----
Apr 02 2005
parent "Regan Heath" <regan netwin.co.nz> writes:
On Sat, 2 Apr 2005 13:08:20 +0200, Thomas Kuehne  
<thomas-dloop kuehne.thisisspam.cn> wrote:
 Regan Heath schrieb am Sat, 02 Apr 2005 22:33:19 +1200:
 On Sat, 2 Apr 2005 12:15:52 +0200, Thomas Kuehne
 <thomas-dloop kuehne.thisisspam.cn> wrote:
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1

 # struct MyStruct{
 #        new(size_t size){
 #                return malloc(size);
 #        }
 # }

 Added to DStress as
 http://dstress.kuehne.cn/run/new_12.d

My impression of: http://www.digitalmars.com/d/memory.html#newdelete is that these are only possible for classes?

New in dmd-0.119: # Changed documentation on struct/union grammar to allow invariants, # unit tests, and allocator/deallocators. See also StructBodyDeclaration at http://www.digitalmars.com/d/struct.html

Ok.. docs need updating. Regan
Apr 02 2005