Re: [Warzone-dev] Memory design problems.
On 6/13/07, Giel van Schijndel [EMAIL PROTECTED] wrote: Dennis Schridde schreef: - Refcounting is probably even better. I like reference counting, in fact it is to my opinion both the safest and most efficient solution of all. However, I do think that unlike C++, which provides constructors and destructors, reference counting will not be easy to use. This is because before destroying a pointer (either because it leaves scope, or whatever other reason) you'd have to call a special destruction function (which decrements the refcount and if it reaches zero destroys the pointed to object in the appropriate way), each and every time a pointer becomes unused. Similarly each and every time you'd copy a pointer you'd have to make sure the reference count is increased. This may seem trivial, but applying this technique on every single pointer we've got is most certainly _not_ trivial. On the bright side, you do not have to do it for *all* pointers, only global pointers, and local pointers in very special functions where the references of your pointers may disappear *during* local execution. - Per ___ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev
Re: [Warzone-dev] Memory design problems.
Am Mittwoch, 13. Juni 2007 schrieb Giel van Schijndel: Dennis Schridde schreef: - Refcounting is probably even better. I like reference counting, in fact it is to my opinion both the safest and most efficient solution of all. However, I do think that unlike C++, which provides constructors and destructors, reference counting will not be easy to use. This is because before destroying a pointer (either because it leaves scope, or whatever other reason) you'd have to call a special destruction function (which decrements the refcount and if it reaches zero destroys the pointed to object in the appropriate way), each and every time a pointer becomes unused. Similarly each and every time you'd copy a pointer you'd have to make sure the reference count is increased. This may seem trivial, but applying this technique on every single pointer we've got is most certainly _not_ trivial. Most prominent user of these smart-pointers would be the droid/projectile lists, where refcounting could probably easily be deployed. --Dennis signature.asc Description: This is a digitally signed message part. ___ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev
[Warzone-dev] [bug #9336] segfault, widget.c line 867 r1510
URL: http://gna.org/bugs/?9336 Summary: segfault, widget.c line 867 r1510 Project: Warzone Resurrection Project Submitted by: urbanvoyeur Submitted on: Friday 06/15/2007 at 02:48 Category: Engine: Graphics Severity: 3 - Normal Priority: 5 - Normal Status: None Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Release: svn Operating System: Microsoft Windows ___ Details: segfault, widget.c line 867 r1510 skirmish, 6 players, t1. Happened less than 5 minutes into game. attached is dump and exe in 7zip from MSVC: call stack: Warzone2100-Dbg.exe!widgGetMouseOver(_w_screen * psScreen=0x051d3f68) Line 867 + 0x5 bytes C Warzone2100-Dbg.exe!intRunWidgets() Line 2148 + 0xb bytes C Warzone2100-Dbg.exe!gameLoop() Line 204 + 0x5 bytesC Warzone2100-Dbg.exe!runGameLoop() Line 524 + 0x5 bytes C Warzone2100-Dbg.exe!mainLoop() Line 691C Warzone2100-Dbg.exe!SDL_main(int argc=6, char * * argv=0x0012fd34) Line 857 C Warzone2100-Dbg.exe!_main() + 0xd1 bytes C [EMAIL PROTECTED]() + 0x1ed bytes C Warzone2100-Dbg.exe!__tmainCRTStartup() Line 589 + 0x35 bytes C Warzone2100-Dbg.exe!WinMainCRTStartup() Line 414 C kernel32.dll!7c816fd7() output: First-chance exception at 0x007594b0 in Warzone2100-Dbg.exe: 0xC005: Access violation reading location 0x0573d43c. Unhandled exception at 0x007594b0 in Warzone2100-Dbg.exe: Locals: - psScreen0x051d3f68 {psForm=0x053411b0 psFocus=0x TipFontID=0 } _w_screen * - psForm 0x053411b0 {formID=0 id=0 type=WIDG_FORM ...} _widget * formID 0 unsigned int id 0 unsigned int typeWIDG_FORM _widget_type style 2 unsigned int x 0 short y 0 short width 1279unsigned short height 1023unsigned short display 0x0053cdd6 _formDisplay void (_widget *, unsigned int, unsigned int, unsigned int *)* callback0x void (_widget *, _w_context *)* pUserData 0x void * UserData0 unsigned int + psNext 0x {formID=??? id=??? type=??? ...} _widget * + psFocus 0x {formID=??? id=??? type=??? ...} _widget * TipFontID 0 int ___ File Attachments: --- Date: Friday 06/15/2007 at 02:48 Name: widget_segf.7z Size: 676kB By: urbanvoyeur http://gna.org/bugs/download.php?file_id=2449 ___ Reply to this item at: http://gna.org/bugs/?9336 ___ Message sent via/by Gna! http://gna.org/ ___ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev