Commit Graph

69 Commits

Author SHA1 Message Date
florian
a7f1ce2e98 * patch by Dmitry Boyarintsev: initialize dyn. arrays more cleverly in a setlength call with ref. count>1, resolves issue #29250
git-svn-id: trunk@32721 -
2015-12-26 08:53:56 +00:00
marco
4733e50de5 * system unit additions from mantis #27206. Exports some dynarray related RTTI functions.
git-svn-id: trunk@29364 -
2015-01-01 00:21:40 +00:00
nickysn
a10c200090 * tdynarraytypedata.elSize changed from PtrUInt to SizeUInt; this fixes e.g.
setlength on dynarrays in the i8086 far data memory models

git-svn-id: trunk@28710 -
2014-09-22 20:18:07 +00:00
sergei
f42c1b3720 * Return dynamic arrays in parameter, this was the only managed type still returned in register. Returning managed types in registers requires catching and re-raising exceptions at callee side in order to finalize result and avoid memory leaks. While such behavior makes little difference with generic setjmp-based exception handling, it becomes very inefficient as SEH-styled exception handling is being introduced.
The new behavior is also Delphi-compatible.

git-svn-id: trunk@26180 -
2013-12-04 13:43:22 +00:00
pierre
a311c53167 Replace HandleErrorFrame calls by HandleErrorAddrFrameInd where possible in common code (to allow correct backtrace for mips cpu)
git-svn-id: trunk@21900 -
2012-07-12 11:53:59 +00:00
sergei
92f927976e * Rewrote fpc_dynarray_copy to trim out-of-range arguments instead of raising range error. Makes behavior Delphi-compatible and resolves #21396.
* Changed copying the entire array to use range 0..high(sizeint) instead of -1..-2.

git-svn-id: trunk@20468 -
2012-03-04 04:41:52 +00:00
sergei
f136e44b6b - RTL: cleaned up remaining 'decr_ref' routines (not removed completely due to bootstrapping needs, but aliased to 'finalize' ones).
git-svn-id: trunk@20130 -
2012-01-20 19:19:08 +00:00
sergei
568ef396fb * Added fpc_dynarray_assign (a helper for dynamic array assignments), added local access to fpc_intf_assign, and switched fpc_copy to use assignment helpers instead of incr_ref/decr_ref combinations.
git-svn-id: trunk@20114 -
2012-01-19 17:43:37 +00:00
sergei
a8fe9601de * Get rid of using pdynarraytypeinfo, instead treat rtti as distinct 'header' and 'data' parts. In variants unit, use rtti declarations from typinfo directly. In system unit, declare private tdynarraytypedata record which (like typinfo.TTypeData) is not packed on alignment-sensitive targets. This simplifies code and removes scary pointer manipulations, should also yield better code on aligned targets.
git-svn-id: trunk@20106 -
2012-01-18 19:28:08 +00:00
sergei
5658c30328 * Partially reverted r20041 to prevent IE200606085 on ARM platforms.
It appears that a function which is present in interface part and aliased to another function using "external name 'foo'" directive cannot be placed immediately before the function to which it is aliased. The body of first function consists of a single jump which fails to be correctly relocated.

git-svn-id: trunk@20053 -
2012-01-11 18:22:43 +00:00
sergei
40f29ffd7a * Generate direct order of indexes passed to fpc_dynarray_setlength at compile time, eliminates the need of reversing them at runtime (in DynArraySetLength).
* 'dimcount' parameter is now of type sizeint everywhere (was dword in fpc_dynarray_setlength and  longint generated by compiler).
Since multi-dimensional dynarrays are not used in compiler code, this change does not break cycling.

git-svn-id: trunk@20041 -
2012-01-10 18:58:20 +00:00
sergei
1fcd40ee64 Continue fixing open array handling:
* Unified fpc_initialize_array,fpc_finalize_array with fpc_decref_array and fpc_addref_array by removing 'size' parameter from the former two. Element size is easily calculated from RTTI, so omitting it simplifies code generation. All four helpers are now callable by tcg.g_array_rtti_helper().
* ncgutil.pas: initialization of open array out-parameters is now done properly (using fpc_initialize_array).
+ Test

git-svn-id: trunk@17081 -
2011-03-05 18:45:44 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
florian
e01e4e5719 * optimized copy(<dyn. array> ...) by checking if the elements are really ref. counted
git-svn-id: trunk@15228 -
2010-05-05 13:49:06 +00:00
Jonas Maebe
65f217ed02 * only set dynarray pointer to nil in decref in case the last reference
has been destroyed (mantis #12000)

git-svn-id: trunk@11672 -
2008-08-31 10:07:53 +00:00
peter
923aac0390 * give range error if setlength value < 0 and the array is not filled
git-svn-id: trunk@9758 -
2008-01-14 18:05:48 +00:00
florian
fd2032dab2 + start of embedded rtl
+ feature support in the compiler

git-svn-id: trunk@5628 -
2006-12-17 18:40:36 +00:00
micha
d704af7216 fix compilation for {$T+} linux/win
git-svn-id: trunk@4794 -
2006-10-04 20:43:55 +00:00
peter
16f121a8bc * reuse generic align()
git-svn-id: trunk@4382 -
2006-08-07 07:03:25 +00:00
yury
11576fd24b * fixed warnings and notes while compiling system unit for wince.
git-svn-id: trunk@4250 -
2006-07-18 15:00:09 +00:00
tom_at_work
9d7ac02696 * fixed tb0488 on unix platforms (missing cwstring uses)
* 64bit big-endian fix of dynamic array handling
* added qword support for %x format specifier of format() functions

git-svn-id: trunk@1773 -
2005-11-16 20:50:38 +00:00
florian
8b3c634573 * fixed DynArraySetLength
git-svn-id: trunk@1678 -
2005-11-06 17:16:55 +00:00
florian
c5f82ba6de + (ole)variant<->error type conversion
+ DynArraySetLength
+ DynArrayFromVariant

git-svn-id: trunk@1608 -
2005-10-30 23:12:08 +00:00
florian
8dd52941d5 * tdynarraytypeinfo moved to interface
* made aligntoptr inlined

git-svn-id: trunk@630 -
2005-07-15 21:09:45 +00:00
michael
198b2104be + Removed HASFUNCTIONCOPYDYNARR define
git-svn-id: trunk@313 -
2005-06-09 18:06:35 +00:00
michael
5cafc069b5 + Removed NOSAVEREGISTERS define
git-svn-id: trunk@307 -
2005-06-09 17:58:20 +00:00
michael
93ba0409be + Removed HASCOMPILERPROC define
git-svn-id: trunk@265 -
2005-06-07 21:41:02 +00:00
michael
7712d4e2d1 + Removed FPC_ALIGNSRTTI define
git-svn-id: trunk@251 -
2005-06-07 20:59:11 +00:00
peter
4ace790492 * remove $Log
git-svn-id: trunk@231 -
2005-06-07 09:47:55 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
Jonas Maebe
9ccf2effdc * fixed web bug #3805
* extra range check in fpc_dynarray_copy (also error if lowidx >
    high(source))
2005-03-27 14:56:34 +00:00
florian
eeaded577a * fixed copy(dyn. array,...); 2005-03-05 16:37:28 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
florian
14c33448af * fixed copy(dyn. array of ansistring) 2005-01-24 21:32:48 +00:00
Jonas Maebe
3f30fb7bb6 * fixed getting pointer to nested dynarray types 2004-11-07 18:31:50 +00:00
Jonas Maebe
405fb30652 * fixed pointer arithmetic errors 2004-11-07 18:02:47 +00:00
florian
b54ea2800a * fixed fpc_dynarry_copy for arm/sparc 2004-11-06 15:29:19 +00:00
florian
4ae980e0bc * fixed dyn. array handling for 32 bit architectures requiering proper alignment 2004-11-03 10:54:36 +00:00
peter
fd759e521f * saveregisters calling convention is obsolete 2004-10-24 20:01:41 +00:00
michael
5cccea2115 + Fix crash when resizing dynamic array 2004-09-15 07:28:09 +00:00
peter
3094258825 * removed warnings 2004-05-31 20:25:04 +00:00
peter
962ef697d5 * remove comment warnings 2004-05-31 14:31:57 +00:00
michael
f4e0bc3881 + Patch from peter to fix crash 2004-05-24 07:18:17 +00:00
florian
3ef5e89682 * fixed <dyn. array>:=nil; 2004-05-20 15:56:32 +00:00
peter
e8f338aa8e * use freemem() without size 2004-05-02 15:15:58 +00:00
peter
48ea64442f * fixed a:=copy(b) 2003-10-29 21:00:34 +00:00
florian
78a00b657b * fixed copy(<dynarray>, ...) 2003-10-25 22:52:07 +00:00
peter
2b6e06bd4a * fixed dynarray copy 2002-11-26 23:02:07 +00:00
florian
b38887e311 + range checking for dyn. arrays 2002-10-09 20:24:30 +00:00