Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,618 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 5 1 2 3 4 5
Re: I need some outsider's perspective... [Re: Uhrwerk] #416996
02/07/13 00:39
02/07/13 00:39
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
Nevermind... Im just a bit thick today... I forgot the sys_marker LOL!


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: I need some outsider's perspective... [Re: Carlos3DGS] #416997
02/07/13 00:50
02/07/13 00:50
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You don't need the sys_marker instruction. It only makes the source of the leak easier to find. But
Code:
#include <acknex.h>

void main()
{
	void* p = sys_malloc(1337);
	sys_exit(NULL);
}

should still result in
Code:
[...]
Unfreed: 943,    , 1340 bytes
Close window at 1.462



Always learn from history, to be sure you make the same mistakes again...
Re: I need some outsider's perspective... [Re: Uhrwerk] #417020
02/07/13 11:50
02/07/13 11:50
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
I just tested it again.
The only change I made this time was commenting sys_marker
My log is empty again...
I dont understand


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: I need some outsider's perspective... [Re: Carlos3DGS] #417029
02/07/13 13:50
02/07/13 13:50
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Have you tried to run the snippet I posted above without the sys_marker? Does that work for you?


Always learn from history, to be sure you make the same mistakes again...
Re: I need some outsider's perspective... [Re: Uhrwerk] #417035
02/07/13 14:34
02/07/13 14:34
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
yup, tried your code but no "unfreed" memory references in the log file
EDIT: mabe it has something to do with some command line options you or me are using?

Last edited by Carlos3DGS; 02/07/13 14:37.

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: I need some outsider's perspective... [Re: Carlos3DGS] #417037
02/07/13 15:22
02/07/13 15:22
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
My only command line option is "-diag". If you weren't using that you'd see no acklog.txt anyways. Are you using the latest version 8.4?


Always learn from history, to be sure you make the same mistakes again...
Re: I need some outsider's perspective... [Re: Uhrwerk] #417038
02/07/13 15:36
02/07/13 15:36
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I think the left triangle in SED ("Run current script") does not generate acklogs, you'd have to start a real test run.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: I need some outsider's perspective... [Re: Superku] #417039
02/07/13 16:00
02/07/13 16:00
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
@Superku: I always use the right (red button), debug run.
I just tested using all three Current, Test, and Debug... Still no sign of it in my log unless I mark first.

@Uhrwerk: Sed says I'm using 8.10.1, acklog.txt files say im using 8.20.1 ... About time I updated I guess...

EDIT: After the update my log indicates version 8.40.3 and your snippet is indicating the unfreed memory withought needing to mark as you said it should ^^

Last edited by Carlos3DGS; 02/07/13 16:33.

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: I need some outsider's perspective... [Re: Carlos3DGS] #417040
02/07/13 17:00
02/07/13 17:00
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Another puzzle solved. :-)


Always learn from history, to be sure you make the same mistakes again...
Re: I need some outsider's perspective... [Re: Uhrwerk] #417327
02/11/13 16:14
02/11/13 16:14
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
I have been playing around with this method you guys tought me to allocate big arrays. Now that I started to feel comfortable using it I decided to make my life more complicated using it with structs. But it seems there is something about how this works that I have not quite understood yet.

What I am trying to do is use a struct (TILE) that will store the data for each tile in my map. And then place an array of the structs inside (ZONE) that contains the map's tile data (array) along with other usefull data.

This is the small test script I am running before actually implementing it in a game:
Code:
#include <acknex.h>
#include <default.c>

typedef struct  TILE
{
	char highID;//2B
	var highDATA;//4B
	char highSTATUS;//2B
	char highANG;//2B
	
	char lowID;//2B
	var lowDATA;//4B	
	char lowSTATUS;//2B
	char lowANG;//2B
		
	ENTITY* highENT;//4B
	ENTITY* lowENT;//4B
}TILE;//28B

typedef struct ZONE
{
	TILE** TILES;//112MB (2048x2048grid)
	int day;//4B
	char type;//2B
	char mode;//2B
	var info;//4B
	char spawntype;//2B
	int maxspawn;//4B
	char spawnrate;//2B
}ZONE;

ZONE MAP;

void map_init()
{
	int ty;
	MAP.TILES = (TILE**)sys_malloc( (int)2048 * sizeof(TILE*) );
	for (ty=0;ty<2048;ty++)
	{
		MAP.TILES[ty] = (TILE*)sys_malloc( (int)2048 * sizeof(TILE) );
	}
}

void main()
{
	level_load(NULL);
	map_init();
	sys_exit(NULL);
}



when running this script it throws the following error at line 40...
Quote:
Error in 'line 40:
subscript requires array or pointer type
<MAP.TILES[ty] = (TILE*)sys_malloc( (int)2048 * sizeof(TILE) );>
Error E355: Startup failure

Can anyone spot what I am doing wrong?


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Page 4 of 5 1 2 3 4 5

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1