Skip to content

Isolate unsafe.Sizeof in a wrapper in a dedicated file #110

@ccoVeille

Description

@ccoVeille

unsafe.Sizeof is used in various place here in this file

Please consider:

  • creating a sizeof.go file

  • add a sizeOfNumber func

  • add this exact comment

       // NOTE: [unsafe.SizeOf] simply returns the size in bytes of the value. 
       // For primitive types T, the generic stencil is precompiled and this value 
       // is resolved at compile time
    
  • call sizeOfNumber everywhere else

This way, only sizeof.go will import the unsafe package and it would be clearer

Originally posted by @ccoVeille in #108 (comment)

ok thanks. I'v been considering that wrapper func too. Perhaps in a follow-up. Now it is time to merge and move on to the next series of packages

Originally posted by @fredbi in #108 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions